function zero = sdp_solve_chi(chi)

global par_;
par_.chi = chi;

params_set;
matrices_set;

opts = optimset('Display','off','TolFun',sqrt(eps),'TolX',sqrt(eps));
switch par_.estim_type
    case 'quick'
        [par_.wbar,fval,flag] = fsolve('sdp_solve_w',par_.wbar,opts);
    case 'robust'
        [par_.wbar,fval,flag] = fzero('sdp_solve_w',[par_.wbar0_min par_.wbar0_max],opts);
end
if flag~=1
    disp('sdp_solve_w did not converge in sdp_solve_chi');
end
sdp_solve_w(par_.wbar);

zero = N_target^(eta)-par_.Cbar*par_.PD;

end